package com.nbsaas.boot.data.rest.resource;

import com.nbsaas.boot.data.api.apis.QueryReportApi;
import com.nbsaas.boot.data.data.entity.QueryReport;
import com.nbsaas.boot.data.api.domain.request.QueryReportRequest;
import com.nbsaas.boot.data.api.domain.response.QueryReportResponse;
import com.nbsaas.boot.data.api.domain.simple.QueryReportSimple;
import com.nbsaas.boot.data.rest.convert.QueryReportSimpleConvert;
import com.nbsaas.boot.data.rest.convert.QueryReportEntityConvert;
import com.nbsaas.boot.data.rest.convert.QueryReportResponseConvert;
import com.nbsaas.boot.data.data.repository.QueryReportRepository;

import java.io.Serializable;
import com.nbsaas.boot.jpa.data.core.BaseResource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import org.springframework.data.jpa.repository.support.JpaRepositoryImplementation;

import java.util.function.Function;
/**
*   -业务接口实现
*/
@Transactional
@Service
public class QueryReportResource extends BaseResource<QueryReport,QueryReportResponse, QueryReportSimple, QueryReportRequest>  implements QueryReportApi {

    @Resource
    private QueryReportRepository queryReportRepository;

    @Override
    public JpaRepositoryImplementation<QueryReport, Serializable> getJpaRepository() {
        return queryReportRepository;
    }

    @Override
    public Function<QueryReport, QueryReportSimple> getConvertSimple() {
        return new QueryReportSimpleConvert();
    }

    @Override
    public Function<QueryReportRequest, QueryReport> getConvertForm() {
        return new QueryReportEntityConvert();
    }

    @Override
    public Function<QueryReport, QueryReportResponse> getConvertResponse() {
        return new QueryReportResponseConvert();
    }




}


